LIKE NOT LIKE RLIKE

LIKE condition is used in situation when you don’t know the exact value or you are looking for some specific pattern in the output. LIKE is similar as in SQL and can be used to specify any pattern in WHERE/FILTER or even in JOIN conditions.

Filter the records jobs Like SAL for DataFrame
empDF.filter($"job".like("SAL%")).show
 
If we want to use NOT LIKE then we will use negation in LIKE statement by adding “!” before column name.

Filter the records jobs not Like SAL for DataFrame
empDF.filter(!$"job".like("SAL%")).show


No comments:

Post a Comment